﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MiruPublic
{
    public class ControlManager
    {
        public static void ShowLoading(Popup popup,string title)
        {
            LoadingUI UI=new LoadingUI();
            if(title!="")
                UI.Title = title;
            popup.Child = UI;
            popup.IsOpen = true;
        }
        public static void ShowLoading(Popup popup, string title,bool CloseIfTap)
        {
            LoadingUI UI = new LoadingUI();

            if (title != "")
                UI.Title = title;
            popup.Child = UI;
            popup.IsOpen = true;
            
            if (CloseIfTap == true)
            {
                UI.Tap += (s, args) =>
                {
                    popup.IsOpen = false;
                };
            }
        }
    }
}
